<!--#include file="pjson.asp"-->
<!DOCTYPE html>
<html>
<head>
  <title></title>
<%
  dim tn
  tn="log1"
  'sessionExpire
  easp.include "h.asp"
%>
  <style type="text/css">
  .layui-form-label {
	width: 80px;
	text-align: left;
}
.reply{display: none; position: absolute; right: 0; bottom: 12px;}
li:hover .reply{display: block;}

.layui-form-item .layui-input-inline {
    float: left;
    width: 260px;
    margin-right: 10px;
}
  </style>
</head>
<body>
<%  


  'gen "CT组","2021-10-10","上午"
%>
  <div class="layui-fluid">
    <div class="layui-card"><br>
      <div class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="test_form">
        <div class="layui-form-item">
          				<div class="layui-inline">
					<% 
          	Echo js2("input1.html","sd","开始日期",val("sd"),"required")
          %>

				</div>
				<div class="layui-inline">
          <%Echo js2("input1.html","ed","结束日期",val("ed"),"required")%>
				</div>
           <%	
           if val("pdfj") <>"" then
            s1 "select id as pdfj from baseinfo where id={pdfj:int}"
           end if
            echo myopt3_no_required("pdfj","医技类型",sql2arr("select id,txt from v_yj1 order by txt  "),val("pdfj"))
            s1 "select id as djzt from baseinfo where id={djzt:int}"
            echo myopt3_no_required("djzt","医技状态",sql2arr("select id,name1 from v_yj2 order by id  "),val("djzt"))
            %>
          <div class="layui-inline">
            <label class="layui-form-label">检索</label>
            <div class="layui-input-block">
              <input type="text" lay-filter="log1_search" id="log1_search" name="<%=tn%>_search" class="layui-input" value="<%=val("log1_search")%>">
            </div>
          </div>

          <div class="layui-inline">
            <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="<%=tn%>_search">
              <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
            </button>
			   <button type="button" class="layui-btn" data-id=50 lay-submit lay-filter="<%=tn%>_add2">手工预约</button>		
         </div>
        </div>
      </div>
      <div class="layui-card-body">
<dl class="layuiadmin-card-status">
<%
	dim i,arr,title_
  'gen "ct","2021-08-18","上午"
  hi "page",val("page")
  hi "yj_count",""

%>
</dl> 
<div id="test1"></div>
	  </div>

    </div>
  </div>
  <script src="/<%=rootpath%>/src/layuiadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: '/<%=rootpath%>/src/layuiadmin/'
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index','form','admin','laypage'], function(){
    var $ = layui.$
    ,admin=layui.admin
    ,laypage = layui.laypage
    ,form = layui.form;

	var laydate = layui.laydate;	
	laydate.render({
		elem: '#sd'
		,value: '<%
    if val("sd")<>"" then
      echo val("sd")
    else
      echo Format_Time(now()-1,2)
    end if  
      %>'	
	  });	
	laydate.render({
		elem: '#ed'
		,value: '<%
    if val("ed")<>"" then
      echo val("ed")
    else
      echo Format_Time(now(),2)
    end if  
      %>'    
	
	  });
    $('#log1_search').focus();
    load_yj_data();
function load_yj_data(){
    url_gg="&log1_search="+$('#log1_search').val()+"&pdfj="+$('#sel_pdfj').val()+"&sd="+$('#sd').val()+"&ed="+$('#ed').val()+"&djzt="+$('#sel_djzt').val();
    $.ajax({
            url:"pj2.asp?action=yj_count"+url_gg,
            success:function(res){
                yj_count=Number(res);
                  laypage.render({
                    elem: 'test1' //注意，这里的 test1 是 ID，不用加 # 号
                    ,count: yj_count
                    ,limit: <%=Easp.Db.PageSize%>
                    ,jump: function(obj, first){
                    //首次不执行
                    //if(!first){
                      $.ajax({
                            url:'pj2.asp?action=yj&page='+obj.curr+url_gg,
                            success:function(res){//res台返回的数据，视情况看是否需要加个下
                                  //alert(res);
                                layer.msg('第 '+ obj.curr +' 页');
                                $('dl.layuiadmin-card-status').html(res);
                                $('#page').val(obj.curr);
                              },
                            error:function(error){
                                    alert('数据加载失败');
                            }
                        });
                    //}
                  }
                  });
              },
            error:function(error){
                    alert('数据加载失败');
            }
        });  
}
  admin.events.log1_upd = function(othis){
    var $ = layui.$;
    var nid = othis.data('id');

    var index_=layer.open({
      type: 2
      ,skin: 'layui-layer-molv'
      ,title: '预约维护'
      ,content: 'yj_frm.asp?now=' + new Date().getTime()+"&id="+nid
      ,maxmin: true
      //,area: ['500px', '450px']
      ,btn: ['确定', '取消']
      ,yes: function(index, layero){
        var iframeWindow = window['layui-layer-iframe'+ index]
        ,submitID = 'LAY-user-front-submit'
        ,submit = layero.find('iframe').contents().find('#'+ submitID);
        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
        var field = data.field; 
          $.post('pj2.asp?now=' + new Date().getTime()+"", {
            action: "yj_upd",
            field
          },
          function(data) {
            layer.msg($.parseJSON(data).msg);
          });
        layer.close(index); //关闭弹层
        });  
        submit.trigger('click');
		    //window.location.href = "http://ab.yjk99.net/dzps/src/views/xxk/log1_ml.asp?log1_search=";
      }
      ,success: function(layero, index){
      }
      });
      layer.full(index_);

  };
    form.on('submit(<%=tn%>_search)', function(data){
 	    var field = data.field;
        load_yj_data();
       //window.location.href = "http://ab.yjk99.net/dzps/src/views/xxk/yj.asp?log1_search="+$('#log1_search').val()+"&pdfj="+$('#sel_pdfj').val()+"&sd="+$('#sd').val()+"&ed="+$('#ed').val()+"&djzt="+$('#sel_djzt').val();
    });	
    form.on('submit(<%=tn%>_add2)', function(data){
     var index_=  layer.open({
        type: 2,skin: 'layui-layer-molv',title: '新增工单',content: '<%=tn%>_frm.asp?now=' + new Date().getTime() +"&type=<%=tn%>",maxmin: true
        //,area: ['500px', '450px']
        ,btn: ['确定', '取消']
        ,yes: function(index, layero){
          var iframeWindow = window['layui-layer-iframe'+ index]
          ,submitID = 'LAY-user-front-submit'
          ,submit = layero.find('iframe').contents().find('#'+ submitID);
          iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
            var field = data.field; 
				$.post('pjson.asp?now=' + new Date().getTime()+"&need_mysql=1", {
					action: "<%=tn%>_add2",
					field
				},
				function(data) {
					layer.msg($.parseJSON(data).msg);
				});
            layer.close(index); 
          });  
          submit.trigger('click');
		      window.location.href = "http://ab.yjk99.net/dzps/src/views/xxk/log1_ml.asp?log1_search="+$('#log1_search').val();
        }
        ,success: function(layero, index){
        }
	  });	
	      layer.full(index_);
    });
  });
  </script>
</body>
</html>